import requests, os

jpg_url = 'http://pic16.photophoto.cn/20100801/0036036385989333_b.jpg'

r = requests.get(jpg_url)
content = r.content

# file_path = os.path.abspath('.') + '/test0515.jpg'
file_name = 'test0515.jpg'
with open(file_name, 'wb') as fp:
    fp.write(content)

# r.text 获取的是unicode字符串
# r.json
# r.content 获取的是二进制数据
# url = 'http://img2.niutuku.com/1312/0804/0804-niutuku.com-27840.jpg'
# r = requests.get(url)
# content = r.content
# with open(r'E:/Python/APITest/APITest/demo_Requests/01.jpg','wb') as fp:
#     fp.write(content)
